package com.huifer.wgx.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Collection;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * <p>Title : PersonnelEntity </p>
 * <p>Description : </p>
 *
 * @author huifer
 * @date 2019-03-20
 */
@Entity
@Table(name = "t_personnel", schema = "at15", catalog = "")
public class PersonnelEntity {

    private Long personnelId;
    private String personnelName;
    private Long functionId;
    private Collection<DetectionLineEntity> tDetectionLinesByPersonnelId;
    private Collection<DetectionPointEntity> tDetectionPointsByPersonnelId;
    private Collection<FieldLineEntity> tFieldLinesByPersonnelId;
    private Collection<FieldPointEntity> tFieldPointsByPersonnelId;
    private Collection<FileEntity> tFilesByPersonnelId;
    private Collection<InteriorLineEntity> tInteriorLinesByPersonnelId;
    private Collection<InteriorPointEntity> tInteriorPointsByPersonnelId;
    private Collection<OperationEntity> tOperationsByPersonnelId;
    private FunctionEntity tFunctionByFunctionId;
    private Collection<ProjectEntity> tProjectsByPersonnelId;
    private Collection<ResultLineEntity> tResultLinesByPersonnelId;
    private Collection<ResultLineAttrEntity> tResultLineAttrsByPersonnelId;
    private Collection<ResultPointEntity> tResultPointsByPersonnelId;
    private Collection<ResultPointAttrEntity> tResultPointAttrsByPersonnelId;
    private Collection<RtkPointEntity> tRtkPointsByPersonnelId;
    private Collection<TaskEntity> tTasksByPersonnelId;
    private Collection<TaskEntity> tTasksByPersonnelId_0;
    private Collection<WorkEntity> tWorksByPersonnelId;

    @Id
    @Column(name = "personnel_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getPersonnelId() {
        return personnelId;
    }

    public void setPersonnelId(Long personnelId) {
        this.personnelId = personnelId;
    }

    @Basic
    @Column(name = "personnel_name", nullable = false, length = 10)
    public String getPersonnelName() {
        return personnelName;
    }

    public void setPersonnelName(String personnelName) {
        this.personnelName = personnelName;
    }

    @Basic
    @Column(name = "function_id", nullable = false)
    public Long getFunctionId() {
        return functionId;
    }

    public void setFunctionId(Long functionId) {
        this.functionId = functionId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PersonnelEntity that = (PersonnelEntity) o;
        return Objects.equals(personnelId, that.personnelId) &&
                Objects.equals(personnelName, that.personnelName) &&
                Objects.equals(functionId, that.functionId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(personnelId, personnelName, functionId);
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<DetectionLineEntity> gettDetectionLinesByPersonnelId() {
        return tDetectionLinesByPersonnelId;
    }

    public void settDetectionLinesByPersonnelId(
            Collection<DetectionLineEntity> tDetectionLinesByPersonnelId) {
        this.tDetectionLinesByPersonnelId = tDetectionLinesByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<DetectionPointEntity> gettDetectionPointsByPersonnelId() {
        return tDetectionPointsByPersonnelId;
    }

    public void settDetectionPointsByPersonnelId(
            Collection<DetectionPointEntity> tDetectionPointsByPersonnelId) {
        this.tDetectionPointsByPersonnelId = tDetectionPointsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<FieldLineEntity> gettFieldLinesByPersonnelId() {
        return tFieldLinesByPersonnelId;
    }

    public void settFieldLinesByPersonnelId(
            Collection<FieldLineEntity> tFieldLinesByPersonnelId) {
        this.tFieldLinesByPersonnelId = tFieldLinesByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<FieldPointEntity> gettFieldPointsByPersonnelId() {
        return tFieldPointsByPersonnelId;
    }

    public void settFieldPointsByPersonnelId(
            Collection<FieldPointEntity> tFieldPointsByPersonnelId) {
        this.tFieldPointsByPersonnelId = tFieldPointsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<FileEntity> gettFilesByPersonnelId() {
        return tFilesByPersonnelId;
    }

    public void settFilesByPersonnelId(
            Collection<FileEntity> tFilesByPersonnelId) {
        this.tFilesByPersonnelId = tFilesByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<InteriorLineEntity> gettInteriorLinesByPersonnelId() {
        return tInteriorLinesByPersonnelId;
    }

    public void settInteriorLinesByPersonnelId(
            Collection<InteriorLineEntity> tInteriorLinesByPersonnelId) {
        this.tInteriorLinesByPersonnelId = tInteriorLinesByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<InteriorPointEntity> gettInteriorPointsByPersonnelId() {
        return tInteriorPointsByPersonnelId;
    }

    public void settInteriorPointsByPersonnelId(
            Collection<InteriorPointEntity> tInteriorPointsByPersonnelId) {
        this.tInteriorPointsByPersonnelId = tInteriorPointsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<OperationEntity> gettOperationsByPersonnelId() {
        return tOperationsByPersonnelId;
    }

    public void settOperationsByPersonnelId(
            Collection<OperationEntity> tOperationsByPersonnelId) {
        this.tOperationsByPersonnelId = tOperationsByPersonnelId;
    }

    @ManyToOne
    @JoinColumn(name = "function_id", referencedColumnName = "function_id", nullable = false,insertable = false,updatable = false)
    public FunctionEntity gettFunctionByFunctionId() {
        return tFunctionByFunctionId;
    }

    public void settFunctionByFunctionId(FunctionEntity tFunctionByFunctionId) {
        this.tFunctionByFunctionId = tFunctionByFunctionId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<ProjectEntity> gettProjectsByPersonnelId() {
        return tProjectsByPersonnelId;
    }

    public void settProjectsByPersonnelId(
            Collection<ProjectEntity> tProjectsByPersonnelId) {
        this.tProjectsByPersonnelId = tProjectsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<ResultLineEntity> gettResultLinesByPersonnelId() {
        return tResultLinesByPersonnelId;
    }

    public void settResultLinesByPersonnelId(
            Collection<ResultLineEntity> tResultLinesByPersonnelId) {
        this.tResultLinesByPersonnelId = tResultLinesByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<ResultLineAttrEntity> gettResultLineAttrsByPersonnelId() {
        return tResultLineAttrsByPersonnelId;
    }

    public void settResultLineAttrsByPersonnelId(
            Collection<ResultLineAttrEntity> tResultLineAttrsByPersonnelId) {
        this.tResultLineAttrsByPersonnelId = tResultLineAttrsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<ResultPointEntity> gettResultPointsByPersonnelId() {
        return tResultPointsByPersonnelId;
    }

    public void settResultPointsByPersonnelId(
            Collection<ResultPointEntity> tResultPointsByPersonnelId) {
        this.tResultPointsByPersonnelId = tResultPointsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<ResultPointAttrEntity> gettResultPointAttrsByPersonnelId() {
        return tResultPointAttrsByPersonnelId;
    }

    public void settResultPointAttrsByPersonnelId(
            Collection<ResultPointAttrEntity> tResultPointAttrsByPersonnelId) {
        this.tResultPointAttrsByPersonnelId = tResultPointAttrsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<RtkPointEntity> gettRtkPointsByPersonnelId() {
        return tRtkPointsByPersonnelId;
    }

    public void settRtkPointsByPersonnelId(
            Collection<RtkPointEntity> tRtkPointsByPersonnelId) {
        this.tRtkPointsByPersonnelId = tRtkPointsByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByTaskDoId")
    @JsonIgnore
    public Collection<TaskEntity> gettTasksByPersonnelId() {
        return tTasksByPersonnelId;
    }

    public void settTasksByPersonnelId(
            Collection<TaskEntity> tTasksByPersonnelId) {
        this.tTasksByPersonnelId = tTasksByPersonnelId;
    }

    @OneToMany(mappedBy = "tPersonnelByTaskAssignId")
    @JsonIgnore
    public Collection<TaskEntity> gettTasksByPersonnelId_0() {
        return tTasksByPersonnelId_0;
    }

    public void settTasksByPersonnelId_0(
            Collection<TaskEntity> tTasksByPersonnelId_0) {
        this.tTasksByPersonnelId_0 = tTasksByPersonnelId_0;
    }

    @OneToMany(mappedBy = "tPersonnelByPersonnelId")
    @JsonIgnore
    public Collection<WorkEntity> gettWorksByPersonnelId() {
        return tWorksByPersonnelId;
    }

    public void settWorksByPersonnelId(
            Collection<WorkEntity> tWorksByPersonnelId) {
        this.tWorksByPersonnelId = tWorksByPersonnelId;
    }
}
